// 定义一个函数，用于生成圆形进度条
@function circular-progress($maxPercent, $percent, $color-bar, $color-bg) {
  // 计算每增加1%的弧度
  $increment: calc(360 / $maxPercent);
  // 计算半圆的弧度
  $half: round($maxPercent / 2);
  // 初始化背景图片
  $background-image: "";
  // 如果百分比小于半圆
  @if $percent <$half {
    // 计算当前弧度
    $nextDeg: calc(90deg + ($increment * $percent));
    // 设置背景图片
    $background-image: "linear-gradient(90deg, #{$color-bg} 50%, transparent 50%,transparent), linear-gradient(#{$nextDeg}, #{$color-bar} 50%, #{$color-bg} 50%,#{$color-bg})";
  } @else {
    // 计算当前弧度
    $nextDeg: calc(-90deg + ($increment * ($percent - $half)));
    // 设置背景图片
    $background-image: "linear-gradient(#{$nextDeg}, #{$color-bar} 50%, transparent 50%,transparent), linear-gradient(270deg, #{$color-bg} 50%, #{$color-bg} 50%,#{$color-bg})";
  }
  // 返回背景图片
  @return unquote($background-image);
}
